import request from '@/utils/request'



// 通知设置接口
// 设置列表查询  查询单个模板
export function NoticeTempList(params) {
    return request({
        url: window.CONFIG.workOrderRestIp + '/msgNotifySetting/getList',
        method: 'post',
        data: params
    })
}
// 设置列表查询新
export function NoticeNewdate(params) {
    return request({
        url: window.CONFIG.workOrderRestIp + '/msgSettingRelation/getData',
        method: 'post',
        data: params
    })
}
// 通过id获取消息数据 用来修改数据的
export function NoticeTempListById(params) {
    return request({
        url: window.CONFIG.workOrderRestIp + '/msgNotifySetting/byId?id=' + params,
        method: 'get',
    })
}
// 启用禁用消息通知设置
export function NoticeTempListForbidden(params) {
    return request({
        url: window.CONFIG.workOrderRestIp + '/msgNotifySetting/forbidden',
        method: 'post',
        data: params
    })
}
// 编辑更新消息通知设置
export function NoticeTempListUpdate(params) {
    return request({
        url: window.CONFIG.workOrderRestIp + '/msgNotifySetting/update',
        method: 'post',
        data: params
    })
}
// 删除消息通知设置(单个/批量)
export function NoticeTempListDelete(params) {
    return request({
        url: window.CONFIG.workOrderRestIp + '/msgNotifySetting/delete',
        method: 'post',
        data: params
    })
}
// 新增消息通知设置
export function NoticeTempListInsert(params) {
    return request({
        url: window.CONFIG.workOrderRestIp + '/msgNotifySetting/insert',
        method: 'post',
        data: params
    })
}
// 获取工单类型接口
export function getWorkOrderTypeByUserId() {
    return request({
        url: window.CONFIG.workOrderRestIp + '/workOrderType/getWorkOrderTypeByUserId?userId=eurmAdmin',
        method: 'get'
    })
}
// 获取流转类型 (流转通知，超时通知...)
export function getNoticeCond() {
    return request({
        url: window.CONFIG.workOrderRestIp + '/sysDict/getDictDetailListByPcode?dictCode=msg_notify_type',
        method: 'get'
    })
}
// 获取通知目标 (创建人，处理人.....)
export function getNoticePerson() {
    return request({
        url: window.CONFIG.workOrderRestIp + '/sysDict/getDictDetailListByPcode?dictCode=msg_notify_target',
        method: 'get'
    })
}
// 获取消息类型(短信，邮件.....)
export function getNoticeMsgType() {
    return request({
        url: window.CONFIG.workOrderRestIp + '/sysDict/getDictDetailListByPcode?dictCode=msg_type',
        method: 'get'
    })
}
// 获取消息模板(传不同参数获取对应模板:msg/sys_msg/eamil)
export function getNoticeTemplateType(params) {
    return request({
        url: window.CONFIG.workOrderRestIp + '/msgTemplate/getByTemplateType?msgTemplateType=' + params,
        method: 'get'
    })
}







// 获取模板类型
export function getNoticeTemp() {
    return request({
        url: window.CONFIG.workOrderRestIp + '/sysDict/getDictDetailListByPcode?dictCode=msg_type',
        method: 'get'
    })
}
// 新增消息模板
export function newAddMsgTemp(params) {
    return request({
        url: window.CONFIG.workOrderRestIp + '/msgTemplate/insert',
        method: 'post',
        data: params
    })
}
// 单个、批量删除
export function deleteListMsg(params) {
    return request({
        url: window.CONFIG.workOrderRestIp + '/msgTemplate/delete',
        method: 'post',
        data: params
    })
}
// 启用禁用
export function startClose(params) {
    return request({
        url: window.CONFIG.workOrderRestIp + '/msgTemplate/forbidden',
        method: 'post',
        data: params
    })
}
// 列表查询  列表搜素
export function getListNotice(params) {
    return request({
        url: window.CONFIG.workOrderRestIp + '/msgTemplate/getList',
        method: 'post',
        data: params
    })
}
// 更新消息模板
export function getInsertNotice(params) {
    return request({
        url: window.CONFIG.workOrderRestIp + '/msgTemplate/update',
        method: 'post',
        data: params
    })
}
// 通过id查询对应模板
export function getInsertNoticeById(params) {
    return request({
        url: window.CONFIG.workOrderRestIp + '/msgTemplate/byId?id=' + params,
        method: 'get'
    })
}
// 上传文件
export function getUploadFile(params, tenantId) {
    return request({
        url: window.CONFIG.workOrderRestIp + '/WorkOrder/special/uploadFile/' + tenantId,
        method: 'post',
        data: params
    })
}
// 根据字典父编码获取子数据
export function getDictDetailListByPcode(params) {
    return request({
        url: window.CONFIG.workOrderRestIp + '/sysDict/getDictDetailListByPcode?dictCode=' + params,
        method: 'get'
    })
}
// 新增字典数据
export function sysDictAdd(params) {
    return request({
        url: window.CONFIG.workOrderRestIp + '/sysDict/add',
        method: 'post',
        data: params
    })
}